package com.meilai.project.constant;

import lombok.Getter;

/**
 * @description 登录类型
 * @author 张驰
 */
@Getter
public enum LoginTypeEnum {
    MINI(1, "小程序"),
    WEB(2, "网页"),
    APP(3, "app");

    private final Integer id;
    private final String name;

    LoginTypeEnum(Integer id, String name) {
        this.id = id;
        this.name = name;
    }

    public static LoginTypeEnum getEnumById(Integer id) {
        for (LoginTypeEnum loginTypeEnum : LoginTypeEnum.values()) {
            if (loginTypeEnum.getId().equals(id)) {
                return loginTypeEnum;
            }
        }
        return null;
    }
}
